//
//  YLReqest.h
//  DoulinClient
//
//  Created by YLKJ on 2019/2/27.
//

#import "YTKRequest.h"

#pragma mark - ------------------ 普通网络请求 ------------------
@interface YLReqest : YTKRequest
/** 加密参数, 有 HTTP 请求头, 不用缓存, 默认 10 秒超时 */
+ (instancetype)reqEncryptAndHeaderParam:(NSDictionary *)param;
+ (instancetype)reqEncryptAndHeaderParam:(NSMutableDictionary *)param UrlString:(NSString*)url;

/** 不加密参数, 有 HTTP 请求头, 使用缓存, 默认 10 秒超时 */
+ (instancetype)reqNOEncryptAndHeaderParam:(NSMutableDictionary *)param UrlString:(NSString*)url;

@end

#pragma mark - ------------------ file上传 ------------------
typedef NS_ENUM(NSInteger, YLUploadMediaType){
    YLUploadMediaTypeJpg,   //图片 image/jpg
    YLUploadMediaTypeAmr,   //语音 audio/amr
    YLUploadMediaTypeMp4,   //视频 video/mp4
};
@interface YLUploadMedia : NSObject
@property (nonatomic, assign) YLUploadMediaType mediaType;
@property (nonatomic, copy) NSString * mediaName;
@property (nonatomic, copy) NSString * mimeName;
@property (nonatomic, copy) NSString * mimeType;
@property (nonatomic, strong) id obj;
+ (instancetype)mediaWithType:(YLUploadMediaType)mediaType mediaName:(NSString *)mediaName mimeName:(NSString *)mimeName obj:(id)obj;
- (instancetype)initWithType:(YLUploadMediaType)mediaType mediaName:(NSString *)mediaName mimeName:(NSString *)mimeName obj:(id)obj;
@end
typedef NS_ENUM(NSInteger, YLUploadType){
    YLUploadTypeAddExpImg,      // 添加达人经历图片
    YLUploadTypeAddDynamic,     // 发布动态/帮帮
    YLUploadTypeAddActivity,    // 创建活动
    YLUploadTypeUpdateIcon,     // 修改头像
    YLUploadTypeAddAlbum,       // 添加相册
    YLUploadTypeUserAuth,       // 实名认证
    YLUploadTypeRefundOrder,    // 申请退款
    YLUploadTypeFeedBack,       // 意见反馈
    YLUploadTypeUploadFile,     // 聊天上传文件
    YLUploadTypeGetMembers,     // 聊天群成员
};
@interface YLUploadRequest : YTKRequest
/** 不加密参数, 有 HTTP 请求头, 不用缓存, 默认 30 秒超时
 * type     上传接口类型
 * fileAry  @[YLUploadMedia]  为视频的时候, 传视频存储的路径
*/
//+ (instancetype)uploadFileType:(YLUploadType)type param:(NSDictionary *)param files:(NSArray*)files;
+ (instancetype)uploadFileReqUrl:(NSString *)Url param:(NSDictionary *)param files:(NSArray*)files;
@end

#pragma mark - ------------------ 加密 ------------------
@interface YTKRequest (Encrypt)
- (NSDictionary *)encryptParams:(id)params;
- (NSDictionary *)noEncryptParams:(id)params;
@end
